package com.study.manage.mvc.org.promotion;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.study.manage.dal.EvaluateApplyRepository;
import com.study.manage.domain.enumm.EvaluateApplyVerifyState;
import com.study.manage.domain.enumm.EvaluateVerify;

@Service
public class PromotionService {

	@Autowired
	private EvaluateApplyRepository evaluateApplyRepository;

	public Map<String, Object> getBaseData(Long id) {
		
		Map<String, Object> map = new HashMap<>();
		map.put("jjCount", evaluateApplyRepository.countByIdAndVerifyAndVerifyState(id,null,EvaluateApplyVerifyState.JJ));
	    map.put("ddCount", evaluateApplyRepository.countByIdAndVerifyAndVerifyState(id,null,EvaluateApplyVerifyState.DD));
	    map.put("bmCount", evaluateApplyRepository.countByIdAndVerifyAndVerifyState(id,EvaluateVerify.Pass,null));
	    map.put("id", id);
		return map; 
	}
    
}
